class edit_menu :
    def __init__ ( self , mediator ) :
        self . _awake = False
        self . _mediator = mediator
        self . _key_escape_counter = None
    def key_escape_counter_reply ( self , counter ) :
        self . _key_escape_counter = counter
    def show_edit_menu ( self ) :
        self . _awake = True
        self . _mediator . key_escape_counter_request ( )
        self . _stored_key_escape_counter = self . _key_escape_counter
        self . _mediator . configure_title_text_for_menu ( self . _mediator . localization_edit_menu_title ( ) )
        self . _mediator . configure_next_row_for_menu \
            ( self . _mediator . localization_edit_menu_continue ( )
            , self . _mediator . on_edit_menu_continue
            )
        self . _mediator . configure_next_row_for_menu \
            ( self . _mediator . localization_edit_menu_save ( )
            , self . _mediator . on_edit_menu_save
            )
        self . _mediator . configure_next_row_for_menu \
            ( self . _mediator . localization_edit_menu_save_as ( )
            , self . _mediator . on_edit_menu_save_as
            )
        self . _mediator . configure_next_row_for_menu \
            ( self . _mediator . localization_edit_menu_return_to_main_menu ( )
            , self . _mediator . on_edit_menu_return_to_main_menu
            )
        self . _mediator . show_menu ( )
    def hide_edit_menu ( self ) :
        self . _awake = False
        self . _mediator . hide_menu ( )
    def on_key_escape ( self ) :
        if self . _awake :
            self . _mediator . key_escape_counter_request ( )
            if self . _key_escape_counter != self . _stored_key_escape_counter :
                self . _mediator . on_edit_menu_continue ( )
